//
//  SEGActivityLotteryDetailModel.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/8/15.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGActivityLotteryDetailModel.h"

@implementation SEGActivityLotteryDetailModel

- (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    self = [super init];
    if (self) {
        _lotteryUsers = [NSArray array];
        _lotteryUserNum = @"";
        _prizes = [NSArray array];
        _price = @"";
        _lotteryTimes = @"";
        _lotteryUsersSort = [NSArray array];
        _lotteryType = @"";
        _freeLotterys = @"";
        _notLotteryPic = @"";
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
+ (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    return [[self alloc] initWithDictionary:dictionary];
}
- (void)setValue:(id)value forUndefinedKey:(NSString*)key
{}
- (void)setPrizes:(NSArray*)prizes{
    NSMutableArray *arrM = [NSMutableArray array];
    [prizes enumerateObjectsUsingBlock:^(NSDictionary* obj, NSUInteger idx, BOOL* _Nonnull stop) {
        if ([obj isKindOfClass:[NSDictionary class]]) {
            [arrM addObject:[SEGActivityLotteryPrizeModel initWithDictionary:obj]];
        }
    }];
    _prizes = [arrM copy];
}

- (void)setLotteryUsers:(NSArray*)lotteryUsers{
    NSMutableArray *arrM = [NSMutableArray array];
    [lotteryUsers enumerateObjectsUsingBlock:^(NSDictionary* obj, NSUInteger idx, BOOL* _Nonnull stop) {
        if ([obj isKindOfClass:[NSDictionary class]]) {
            [arrM addObject:[SEGActivityLotteryUsersModel initWithDictionary:obj]];
        }
    }];
    _lotteryUsers = [arrM copy];
}

- (void)setLotteryUsersSort:(NSArray*)lotteryUsersSort{
    NSMutableArray *arrM = [NSMutableArray array];
    [lotteryUsersSort enumerateObjectsUsingBlock:^(NSDictionary* obj, NSUInteger idx, BOOL* _Nonnull stop) {
        if ([obj isKindOfClass:[NSDictionary class]]) {
            [arrM addObject:[SEGActivityLotteryUsersSortModel initWithDictionary:obj]];
        }
    }];
    _lotteryUsersSort = [arrM copy];
}

- (void)setLotteryUserNum:(NSString*)lotteryUserNum{
    _lotteryUserNum = [[SEGUtils ValueToString:lotteryUserNum]copy];
}

- (void)setPrice:(NSString*)price{
    _price = [[SEGUtils ValueToString:price]copy];
}
- (void)setLotteryTimes:(NSString*)lotteryTimes{
    _lotteryTimes = [[SEGUtils ValueToString:lotteryTimes]copy];
}

- (void)setLotteryType:(NSString*)lotteryType{
    _lotteryType = [[SEGUtils ValueToString:lotteryType]copy];
}
- (void)setFreeLotterys:(NSString*)freeLotterys{
    _freeLotterys = [[SEGUtils ValueToString:freeLotterys]copy];
}
- (void)setNotLotteryPic:(NSString*)notLotteryPic{
    _notLotteryPic = [[SEGUtils ValueToString:notLotteryPic]copy];
}

@end
